{% extends "car/car_index.html" %}
{% load staticfiles %}
{% block content %}
    <style>
        .car_logs {
            width: 80%;
            height: 150px;
            margin-left: 10%;
            border-radius: 20px;
            margin-top: 20px;
            position: relative
        }

        .ok {
            border: 2px solid green;
            box-shadow: 1px 1px 1px green
        }

        .fild {
            border: 2px solid red;
            box-shadow: 1px 1px 1px red
        }
    </style>
    <div style="float: right;margin: 20px;margin-right: 10%;"><a href="/car/index/" id="a">
        <button type="button" class="btn btn-primary btn-lg">返回上一级</button>
    </a></div>
    <div class="a" style="font-size: 3rem;margin: 20px;margin-left: 10%;font-weight: bold">用车记录
    </div>
    {% if not data %}
        <div class="a" style="font-size: 3rem;margin: 20px;margin-left: 10%;font-weight: bold">无用车记录</div>
    {% endif %}
    {% for i in data %}
        {% if i.status == 1 %}
            <div class="car_logs ok">
                <p style="margin:10px;margin-top: 15px;"> 申请人：{{ i.name }} <span
                        style="margin-left: 10%;">用车时间：{{ i.time1 }}—{{ i.time2 }}</span>
                    <span style="margin-left: 10%;">车型：{{ i.car_name }}</span> <span
                            style="margin-left: 3%">{{ i.car_card }}</span></p>
                <p style="margin:10px;"> 到达地点：{{ i.where }} <span style="margin-left: 3%">申请时间:{{ i.time }}</span></p>
                <p style="margin:10px;"> 人数：{{ i.num }} <span style="margin-left: 3%">开车人：{{ i.siji }}</span><span
                        style="margin-left: 3%">用车原因：{{ i.resign }}</span></p>

                <p style="margin:10px;"> 组长/审批人：{{ i.shenpi }}
                    <span style="margin-left: 10%">审批结果：<span style="color: green">同意</span></span>
                    <span style="margin-left: 10%">意见：{{ i.yijian }}</span></p>
            </div>
        {% elif i.status == 2 %}
            <div class="car_logs fild">
                <p style="margin:10px;margin-top: 15px;"> 申请人：{{ i.name }} <span
                        style="margin-left: 10%;">申请时间：{{ i.time1 }}—{{ i.time2 }}</span>
                    <span style="margin-left: 10%;">车型：{{ i.car_name }}</span> <span
                            style="margin-left: 3%">{{ i.car_card }}</span></p>
                <p style="margin:10px;"> 到达地点：{{ i.where }}<span style="margin-left: 3%">申请时间:{{ i.time }}</span></p>
                <p style="margin:10px;"> 人数：{{ i.num }} <span style="margin-left: 3%">开车人：{{ i.siji }}</span><span
                        style="margin-left: 3%">用车原因：{{ i.resign }}</span></p>

                <p style="margin:10px;"> 组长/审批人：{{ i.shenpi }}
                    <span style="margin-left: 10%">审批结果：<span style="color: red">不同意</span></span>
                    <span style="margin-left: 10%">意见：{{ i.yijian }}</span></p>
            </div>
        {% else %}
        {% endif %}
    {% endfor %}

{% endblock %}
